gdk_x11_get_xatom_by_name_for_display (display, "SM_CLIENT_ID"));
}
-void
-gdk_display_setup_window_visual (GdkDisplay *display,
- int depth,
- Visual *visual,
- Colormap colormap,
- gboolean rgba)
-{
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
-
- display_x11->window_depth = depth;
- display_x11->window_visual = visual;
- display_x11->window_colormap = colormap;
-
- gdk_display_set_rgba (display, rgba);
-}
-
/**
* gdk_x11_display_open:
* @display_name: (nullable): name of the X display.
#endif
/* initialize the display's screens */
- display_x11->screen = _gdk_x11_screen_new (display, DefaultScreen (display_x11->xdisplay), TRUE);
+ display_x11->screen = _gdk_x11_screen_new (display, DefaultScreen (display_x11->xdisplay));
+
+ if (display_x11->screen->rgba_visual)
+ {
+ Visual *xvisual = GDK_X11_VISUAL (display_x11->screen->rgba_visual)->xvisual;
+
+ display_x11->window_depth = display_x11->screen->rgba_visual->depth;
+ display_x11->window_visual = xvisual;
+ display_x11->window_colormap = XCreateColormap (xdisplay,
+ DefaultRootWindow (xdisplay),
+ xvisual,
+ AllocNone);
+ gdk_display_set_rgba (display, TRUE);
+ }
+ else
+ {
+ display_x11->window_depth = DefaultDepth (xdisplay, DefaultScreen (xdisplay)),
+ display_x11->window_visual = DefaultVisual (xdisplay, DefaultScreen (xdisplay));
+ display_x11->window_colormap = DefaultColormap (xdisplay, DefaultScreen (xdisplay));
+ gdk_display_set_rgba (display, FALSE);
+ }
/* We need to initialize events after we have the screen
* structures in places
if (gdk_x11_display_error_trap_pop (display) || !result)
return NULL;
- screen = _gdk_x11_screen_new (display, XScreenNumberOfScreen (attrs.screen), FALSE);
+ screen = _gdk_x11_screen_new (display, XScreenNumberOfScreen (attrs.screen));
display_x11->screens = g_list_prepend (display_x11->screens, screen);
void _gdk_x11_error_handler_push (void);
void _gdk_x11_error_handler_pop (void);
-void gdk_display_setup_window_visual (GdkDisplay *display,
- int depth,
- Visual *visual,
- Colormap colormap,
- gboolean rgba);
int gdk_x11_display_get_window_depth (GdkX11Display *display);
Visual * gdk_x11_display_get_window_visual (GdkX11Display *display);
Colormap gdk_x11_display_get_window_colormap (GdkX11Display *display);
GdkX11Screen *
_gdk_x11_screen_new (GdkDisplay *display,
- int screen_number,
- gboolean setup_display)
+ int screen_number)
{
GdkX11Screen *x11_screen;
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
init_randr_support (x11_screen);
init_multihead (x11_screen);
- _gdk_x11_screen_init_visuals (x11_screen, setup_display);
+ _gdk_x11_screen_init_visuals (x11_screen);
return x11_screen;
}
GType _gdk_x11_screen_get_type (void);
GdkX11Screen *_gdk_x11_screen_new (GdkDisplay *display,
- int screen_number,
- gboolean setup_display);
+ int screen_number);
void _gdk_x11_screen_window_manager_changed (GdkX11Screen *screen);
void _gdk_x11_screen_size_changed (GdkX11Screen *screen,
const char *name,
GValue *value);
-void _gdk_x11_screen_init_visuals (GdkX11Screen *screen,
- gboolean setup_display);
+void _gdk_x11_screen_init_visuals (GdkX11Screen *screen);
G_END_DECLS
}
void
-_gdk_x11_screen_init_visuals (GdkX11Screen *x11_screen,
- gboolean setup_display)
+_gdk_x11_screen_init_visuals (GdkX11Screen *x11_screen)
{
static const int possible_depths[8] = { 32, 30, 24, 16, 15, 8, 4, 1 };
static const GdkVisualType possible_types[6] =
* stereo and double buffering
*/
gdk_x11_screen_update_visuals_for_glx (x11_screen);
-
- if (setup_display)
- {
- if (x11_screen->rgba_visual)
- {
- Visual *xvisual = GDK_X11_VISUAL (x11_screen->rgba_visual)->xvisual;
- Colormap colormap;
-
- colormap = XCreateColormap (x11_screen->xdisplay,
- RootWindow (x11_screen->xdisplay, x11_screen->screen_num),
- xvisual,
- AllocNone);
- gdk_display_setup_window_visual (GDK_SCREEN_DISPLAY (x11_screen),
- x11_screen->rgba_visual->depth,
- GDK_X11_VISUAL (x11_screen->rgba_visual)->xvisual,
- colormap,
- TRUE);
- }
- else
- {
- gdk_display_setup_window_visual (GDK_SCREEN_DISPLAY (x11_screen),
- DefaultDepth (x11_screen->xdisplay, x11_screen->screen_num),
- DefaultVisual (x11_screen->xdisplay, x11_screen->screen_num),
- DefaultColormap (x11_screen->xdisplay, x11_screen->screen_num),
- FALSE);
- }
- }
}
/*< private >